package com.tensquare.recruit.dao;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import com.tensquare.recruit.pojo.Recruit;

import java.util.List;

/**
 * 数据访问接口
 *
 * @author Administrator
 */
public interface RecruitDao extends JpaRepository<Recruit, String>, JpaSpecificationExecutor<Recruit> {

    //查询推荐职位,根据state=2进行查询,根据职位发布时间的倒序排序
    List<Recruit> getByStateOrderByCreatetimeDesc(String state);

    //查询最新职位,更具state!=0进行查询,根据职位发布时间的倒序排序
    //在实际开发的时候,千万不要一会find一会get,一会query
    List<Recruit> queryByStateNotOrderByCreatetimeDesc(String state);
}
